home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
xtrv1.zip
/
XTRACT.DOC
< prev
next >
Wrap
Text File
|
1993-01-05
|
11KB
|
330 lines
XTRACT data extraction and reformatting.
Copyright 1991 by A.P.Cunningham
Shareware Version 1.0 July 1922
This program bas created to save the frequently laborious
task of converting data from one format to another as is often
the case when moving data between different applications.
Xtract makes it easy for you to specify how a text file should
be reformatted into the form that you need for input into a
spreadsheet, database or stats package.
XTRACT is simple to use and has been designed to minimise
the number of keystrokes needed to specify how the data is to
be reformatted. Because XTRACT uses a visual marking system,
you don't need to calculate where fields begin and end in the
input document. XTRACT takes note of the order you choose
when you mark fields and you can use this facility to control
the sequence of data in your output file. For example, XTRACT
makes short work of changing date formats from US to UK.
XTRACT keeps a record of the fields you have marked by
saving a template in a separate file. You can edit this
template later or re-use it unchanged to extract data from
sets of similarly formatted documents.
Demonstration:
First unpack the software into a directory (using the
program PKUNZIP) by typing:-
PKUNZIP XTRACT
Next type:- DEMO
This will start XTRACT using a data file called TEMP.DAT
When you have looked at the screen, try pressing the
tab key a few times - the cursor should move between the
fields in the order they were marked. Then press the F2
key and the program will finish and create a file called
TEST.XTR.
Use a file browser or text editor to look at the files
TEST.DAT & TEST.XTR and see how the data has been
reformatted.
Starting XTRACT:
You start by typing the program name XTRACT followed by
the file name of your input document eg:-
XTRACT mydoc.dat
Note: If you type the filename without its extension,
then XTRACT will assume that the extension is .dat.
Creating the template:
When you start XTRACT, part of the first page of your
document is displayed on the screen. You can see more of
the document by using the Page-Up & Page-Down keys. If
the document is wider then the screen, then use <Ctrl>
plus Right or Left arrow keys to scroll sideways.
You start creating the template by using the arrow keys
to move the cursor to the beginning of the first field.
You then use the space bar to 'over-type' the field area
which will change to a different colour.
Should you need to distinguish between text and numeric
fields, you can indicate a text field by pressing the "
key whilst the cursor is located in the field.
If the application's input needs a comma, colon or /
between the fields, then type the appropriate symbol
whilst the cursor is in the marked field. If you omit
the symbol, then the separator will be a space. If you
wish to join this field onto another area in a different
part of the document, then you must type in a + in place
of the separator symbol.
You can now move on to the next area by using the
standard cursor movement keys and mark the field as
before. Continue to do this until you have completed
marking just the first page of the document. Then move
to the end of the first page and type * to indicate the
page break.
If you wish to separate a continuous area into two or
more distinct fields, then use the \ key in place of the
space bar to mark the first position in the next field
and use the space bar to highlight the remainder of the
field. The \ will not be printed and the colour will
change to indicate that you are marking a new area. If
you have already typed in a separator symbol at the end
of the first field, don't worry, just type the \ on top.
If you have been too enthusiastic in marking an area
and made the field too big, then use the Delete key to
reduce the size or erase the marking altogether.
Where there are tables in your document, you need only
mark up the first row of the table. When you have done
this press the F3 key to flag this line. Next move to
the bottom of the table and press the F5 key, you will
see all the intervening lines become marked up in the
same way as the flagged line. When the lines are not
next to each other, you will need to use the F4 key to
copy the markings from the flagged line.
If you wish to be reminded of the order in which you
created the marked areas, just press the tab key to move
between fields.
Before you finish, check that you have marked the last
line in the first page of your document with the * key.
Should you mark the wrong line, then you will find that
subsequent pages of the input file will be incorrectly
reformatted.
You can start the formatting process, by pressing the
F2 key. When this operation has been completed, XTRACT
will terminate placing the results in a file with the
0extension .xtr and save the template to a file with the
extension .fld. If your input file was mydoc.dat then
the output file will be mydoc.xtr and the template file
will be mydoc.fld.
There are two other ways you can exit from XTRACT, Esc
exits immediately saving nothing and F7 just saves the
template but does not create a reformatted output file.
You can correct any mistakes in formatting by re-
running XTRACT and editing the template. You can also
try using an editor to alter the template file, and then
run XTRACT to check the alignment of the marked areas.
Quick Reference
Start-up:
Just type:-
XTRACT filename
Note: 1. The default extension of the input file is .dat
2. The output file extension will be .xtr
3. The template file extension will be .fld
Marking fields:
When the document appears use the space bar to mark
the fields and the cursor keys to move between fields.
For wide documents, use Ctrl + arrow keys (-> & <-) to
scroll right and left. The help key (F1) summarises the
main keys.
Joining areas:
After marking the first area, type a + symbol at then.
Then move to the next area and mark it. If there are any
mor areas to join, continue the process of adding a + and
marking the next area. The areas will be joined in the
order of marking.
Reviewing order of marking:
If you press the tab key, the cursor will step from
one marked area to the next in the same order that the
areas were marked.
Splitting joined fields:
Where one field runs into the next, use the \ symbol
to mark the beginning of the next field. Use the space
bar to mark the remainder of the field's area. You will
see the next area highlighted in a different colour.
Specifying separators:
You can specify a field separator by typing a valid
symbol at the end of a marked area. The valid symbols
are:- ,./: plus the return key, which splits the output
into more then one line.
Specifying text field:
Place the cursor within the highlighted area and press
the " key.
Duplicating marked areas:
To duplicate a line containing fields already marked,
press F3 (with the cursor in the line) to flag the line.
Move the cursor to another line below; now when you press
F4, the marked areas of the flagged line will be copied.
If you press F5 instead of F4, then all the intervening
lines will be mark